﻿using UnityEngine;
using System.Collections;

public class Flyer : MonoBehaviour {

    public int health;
    public bool IsAlive { get { return health > 0; } }


	void Awake()
    {
    }
    public void MoveTo(Vector3 pos)
    {
        transform.localPosition = pos;
    }

    public void ReceiveDamage(int damage)
    {
        health -= damage;
        if(health<=0)
        {
            GetComponent<Animator>().SetTrigger("explode");
        }
    }

    public void Explode()
    {
        Destroy(gameObject);
    }
	
	// Update is called once per frame
	void Update () {
	
	}
}
